package com.core.website.service.impl;

import com.core.website.entity.Team;
import com.core.website.mapper.TeamMapper;
import com.core.website.service.TeamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class TeamServiceImpl implements TeamService {
    @Autowired
    private TeamMapper teamMapper;

    @Override
    public int add(Team team) {
        team.setId(UUID.randomUUID().toString().toUpperCase().replace("-", ""));
        return teamMapper.add(team);
    }

    @Override
    public int edit(Team team) {
        return teamMapper.edit(team);
    }

    @Override
    public int delete(List<String> ids) {
        return teamMapper.delete(ids);
    }

    @Override
    public List<Team> queryAll(Team team) {
        List<Team> result=teamMapper.queryAll(team);
        return result;
    }

    @Override
    public Team queryOne(String id) {
        Team team=teamMapper.queryById(id);
        return team;
    }
}
